package com.zyp.command;


/**
 *	 
 *	抽象命令类，用来声明执行操作的接口
 */
public abstract class ICommand {
	
	protected Receiver receiver;
	
	public ICommand(Receiver receiver){
		this.receiver=receiver;
	}

	public abstract void execute();
	
}


/**
 * 
 *	具体命令类，实现具体命令	
 *
 */
class CommandA extends ICommand{
	
	public CommandA(Receiver receiver) {
		super(receiver);
	}

	@Override
	public void execute() {
		receiver.doAction();
	}
	
}
